from scapy.all import *
import time
import sys, getopt

class MF(Packet):
    fields_desc=[ XBitField("mf_type", None, 32),
                  XBitField("src_guid", None, 32),
                  XBitField("dest_guid", None, 32)
                
                  ]

if __name__ == "__main__":

    L2=Ether(src=sys.argv[1],dst=sys.argv[2],type=0x27C0)
    #对应netcfg文件中的h41的address的值
    L3=MF(dest_guid=int(sys.argv[3]))
    pkt=L2/L3
    pkt.show()
    hexdump(pkt)
    while 1:
        time.sleep(1)
        sendp(pkt, iface=sys.argv[4])

